﻿<Window x:Class="OptionsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="オプション" Width="600" Height="400"
    Icon="../Images/gear_small.png">

    <Window.BindingGroup>
        <BindingGroup />
    </Window.BindingGroup>
    
    <Window.Resources>
        <XmlDataProvider x:Key="Pages">
            <x:XData>
                <Pages xmlns="">
                    <Page Uri="OptionPages\BasicPage.xaml" Title="基本設定" Icon="../Images/bell_small.png" />
                    <Page Uri="OptionPages\KeywordPage.xaml" Title="キーワード" Icon="../Images/highlighter_small.png" />
                    <Page Uri="OptionPages\BrowserPage.xaml" Title="Webブラウザ" Icon="../Images/browser_small.png" />
                    <Page Uri="OptionPages\SoundPage.xaml" Title="サウンド" Icon="../Images/sound_small.png" />
                    <Page Uri="OptionPages\PluginPage.xaml" Title="プラグイン" Icon="../Images/puzzle_small.png" />
                    <Page Uri="OptionPages\FontPage.xaml" Title="フォント" Icon="../Images/document-attribute_small.png" />
                    <Page Uri="OptionPages\NGSettingsPage.xaml" Title="NG設定" Icon="../Images/slash_small.png" />
                    <Page Uri="OptionPages\DetailsPage.xaml" Title="詳細設定" Icon="../Images/gear_small.png" />
                </Pages>
            </x:XData>
        </XmlDataProvider>
    </Window.Resources>
    <DockPanel Margin="5">
        <Grid DockPanel.Dock="Bottom" HorizontalAlignment="Right">
            <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                <Button Content="OK" Width="100" IsDefault="True" Click="OkButton_Click" />
                <Button Content="キャンセル" Width="100" Margin="5 0 0 0" IsCancel="True" Click="Cansel_Click" />
            </StackPanel>
        </Grid>
        <Grid>        
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <ListView
                x:Name="PageList"
                SelectedIndex="0"
                ItemsSource="{Binding Source={StaticResource Pages}, XPath=Pages/Page}"
                SelectedValuePath="@Uri">
                <ListView.View>
                    <GridView>
                        <GridView.ColumnHeaderContainerStyle>
                            <Style TargetType="FrameworkElement">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </Style>
                        </GridView.ColumnHeaderContainerStyle>
                    
                        <GridViewColumn>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Margin="1">
                                        <Image Source="{Binding XPath=@Icon}" Style="{StaticResource SmallIconStyle}" VerticalAlignment="Center" />
                                        <TextBlock Text="{Binding XPath=@Title}" VerticalAlignment="Center" Margin="5 0 3 0" />
                                    </StackPanel>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView>
                    
                </ListView.View>
            </ListView>

           
            <Grid Grid.Column="1" Margin="5 0 0 0">
                <Frame x:Name="ContentFrame" 
                       Source="{Binding ElementName=PageList, Path=SelectedValue}" 
                       NavigationUIVisibility="Hidden" />
            </Grid>
            
        </Grid>
    </DockPanel>

</Window>
